package model;

import java.util.LinkedList;

import services.PlaylistInteractionService;
import services.UserYoutubeService;
import services.YoutubeUploadService;
import model.YouTubePlayList;
public class YoutubeChannel {

	private String username;
	private String password;
	private UserYoutubeService userYouTubeService;
	private YoutubeUploadService userUploadClient;
	private PlaylistInteractionService playlistInteractionService;
	private LinkedList<YouTubeEntry> uploadlist;
	public YoutubeChannel(String username, String password)
	{
		this.username = username;
		this.password = password;
		this.uploadlist = new LinkedList<YouTubeEntry>();
		this.playlists = new LinkedList<YouTubePlayList>();
		this.initUser();
	}
	
	public YoutubeChannel(String username, String password, LinkedList<YouTubeEntry> uploadlist)
	{
		this.username = username;
		this.password = password;
		this.uploadlist = uploadlist;
		this.playlists = new LinkedList<YouTubePlayList>();
		this.initUser();
	}
	
	public YoutubeChannel(String username, String password, LinkedList<YouTubeEntry> uploadlist, LinkedList<YouTubePlayList> playlists)
	{
		this.username = username;
		this.password = password;
		this.uploadlist = uploadlist;
		this.playlists = playlists;
		this.initUser();
	}
	
	public void initUser()
	{
		this.userYouTubeService = new UserYoutubeService(this.username, this.password);
		this.playlistInteractionService = new PlaylistInteractionService(this.userYouTubeService.getYoutubeService());
	}

	private LinkedList<YouTubePlayList> playlists;

	public UserYoutubeService getUserYouTubeService() {
		return userYouTubeService;
	}

	public PlaylistInteractionService getPlaylistInteractionService() {
		return playlistInteractionService;
	}

	public String getUsername() {
		return username;
	}

	public YoutubeUploadService getUserUploadClient() {
		return userUploadClient;
	}

	public LinkedList<YouTubeEntry> getUploadQueue() {
		return uploadlist;
	}

	public void setUploadQueue(LinkedList<YouTubeEntry> uploadlist) {
		this.uploadlist = uploadlist;
	}
	
	public void addToUploadList(YouTubeEntry youtubevideo){
		this.uploadlist.add(youtubevideo);
	}

	public LinkedList<YouTubePlayList> getPlaylists() {
		return this.playlists;
	}

	public void setPlaylists(LinkedList<YouTubePlayList> playlists) {
		this.playlists = playlists;
	}
	
}
